package jp.bgbt.fles.app.bean;

import java.io.Serializable;

public class StrategyDetailsBean implements Serializable {


    private int ledPattern; //模式  0为用户设置  其他 自动模式
    private int ledSkinType = 1; // 肤质类型
    private int ledDuration = 1; // 时长
    private String deviceId; // 设备mac
    private int ledAge = 1; //年龄
    private String driverKey; // 肤质+年龄+是否自动模式+实际模式

    private static class SingletonHolder {
        private static jp.bgbt.fles.app.bean.StrategyDetailsBean INSTANCE = new jp.bgbt.fles.app.bean.StrategyDetailsBean();
    }

    public static jp.bgbt.fles.app.bean.StrategyDetailsBean getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public String getDriverKey() {
        return driverKey;
    }

    public void setDriverKey(String driverKey) {
        this.driverKey = driverKey;
    }

    public int getLedPattern() {
        return ledPattern;
    }

    public void setLedPattern(int ledPattern) {
        this.ledPattern = ledPattern;
        if(ledPattern == 0) {
            ledDuration = 20;
        } else {
            ledDuration = 10;
        }
        if(ledPattern == 0) {
            driverKey = "";
        } else {
            driverKey = "xx1" + ledAge + 0 + ledPattern + "xx";
        }
    }

    public void confirmLedPattern(int param1, int param2) {
        driverKey = "xx1" + ledAge + param1 + param2 + "xx";
    }

    public int getLedAge() {
        if (ledAge == 0)
            ledAge = 1;
        return ledAge;
    }

    public void setLedAge(int ledAge) {
        this.ledAge = ledAge;
    }

    public int getLedSkinType() {
        if (ledSkinType == 0)
            ledSkinType = 1;
        return ledSkinType;
    }

    public void setLedSkinType(int ledSkinType) {
        this.ledSkinType = ledSkinType;
    }

    public int getLedDuration() {
        if (ledDuration == 0)
            ledDuration = 1;
        return ledDuration;
    }

    public void setLedDuration(int ledDuration) {
        this.ledDuration = ledDuration;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

}
